package factory

import "math"

// 生产产品的抽象和实现

type Shape interface {
	Area() float64
}

type Rectangle struct {
	width, height float64
}

func (r *Rectangle) Area() float64 {
	return r.width * r.height
}

type Circle struct {
	radius float64
}

func (c *Circle) Area() float64 {
	return c.radius * c.radius * math.Pi
}

type ShapeParam struct {
	Radius float64
	Width  float64
	Height float64
}
